<?php

namespace common\models\linkedcare;

use Yii;

/**
 * This is the model class for table "{{%fy_linkedcare_channel}}".
 *
 * @property int $id
 * @property int $parent_id
 * @property string $source_name
 * @property string|null $source_name_code
 * @property int $level
 * @property int $status 状态【-1删除、0禁用、1启用】
 * @property int|null $office_id
 * @property string|null $patient_source_type_contacter
 * @property string $created_at 创建时间
 * @property string|null $updated_at 更新时间
 */
class LinkedcareChannel extends \common\models\base\BaseModel
{
    const STATUS_DELETE = -1;// 删除
    const STATUS_INVALID = 0;// 失效
    const STATUS_ENABLE = 1;// 正常

    const LEVEL_FIRST = 1;
    const LEVEL_SECOND = 2;
    const LEVEL_THIRD = 3;

    public static $statuss = [
        self::STATUS_DELETE => '删除',
        self::STATUS_INVALID => '禁用',
        self::STATUS_ENABLE => '正常',
    ];

    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%fy_linkedcare_channel}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['id', 'parent_id', 'level'], 'required'],
            [['id', 'parent_id', 'level', 'status', 'office_id'], 'integer'],
            [['created_at', 'updated_at'], 'safe'],
            [['source_name'], 'string', 'max' => 100],
            [['source_name_code'], 'string', 'max' => 32],
            [['patient_source_type_contacter'], 'string', 'max' => 255],
            [['id'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'parent_id' => 'Parent ID',
            'source_name' => 'Source Name',
            'source_name_code' => 'Source Name Code',
            'level' => 'Level',
            'status' => '状态【-1删除、0禁用、1启用】',
            'office_id' => 'Office ID',
            'patient_source_type_contacter' => 'Patient Source Type Contacter',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
        ];
    }
}
